package com.wedo.mall.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 商品属性-item
 * Created by e on 2017/7/11.
 */

public class AttrItem implements Parcelable {


    /**
     * id : 4
     * attr_name_id : 3
     * attr_value : 国产
     */

    public String id;
    public String attr_name_id;
    public String attr_name;
    public String attr_value;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AttrItem)) return false;

        AttrItem attrItem = (AttrItem) o;

        return id.equals(attrItem.id);
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.attr_name_id);
        dest.writeString(this.attr_value);
        dest.writeString(this.attr_name);
    }

    public AttrItem() {
    }

    protected AttrItem(Parcel in) {
        this.id = in.readString();
        this.attr_name_id = in.readString();
        this.attr_value = in.readString();
        this.attr_name = in.readString();
    }

    public static final Parcelable.Creator<AttrItem> CREATOR = new Parcelable.Creator<AttrItem>() {
        @Override
        public AttrItem createFromParcel(Parcel source) {
            return new AttrItem(source);
        }

        @Override
        public AttrItem[] newArray(int size) {
            return new AttrItem[size];
        }
    };
}
